package org.hishen.example.entity.mall;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hishen.example.entity.AbstractBaseEntity;
import org.hishenframework.data.annotation.Label;

/**
 * 商品
 * @author ZhangDi
 *
 */
@Entity
@Table(name = "mall_goods")
@Label("商品")
public class Goods extends AbstractBaseEntity {
	
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer id;
	
	/** 商品所属类别 */
	@ManyToOne
	@Label("类别")
	private Category category;
	
	/** 商品名称 */
	@Column(nullable = false, length = 50)
	@Label("名称")
	private String goodsname;
	
	/** 价格 */
	@Label("价格")
	private BigDecimal price;
	
	/** 库存 */
	@Label("库存")
	private Integer stock;
	
	/** 商品详情 */
	@Column(length = 10000)
	@Label("详情")
	private String details;

	@Label("上架")
	private Boolean added;
	
	public String getGoodsname() {
		return goodsname;
	}

	public void setGoodsname(String goodsname) {
		this.goodsname = goodsname;
	}

	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	public Integer getStock() {
		return stock;
	}

	public void setStock(Integer stock) {
		this.stock = stock;
	}

	public String getDetails() {
		return details;
	}

	public void setDetails(String details) {
		this.details = details;
	}

	public Category getCategory() {
		return category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Boolean getAdded() {
		return added;
	}

	public void setAdded(Boolean added) {
		this.added = added;
	}
}
